
package ejemplodeawt;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class fontYCerrarVentana {
public static void main(String args[]){
        Frame f=new Frame();
Panel p=new Panel();
Button b=new Button("boton");
TextField tf=new TextField();
TextArea ta=new TextArea();
ta.setForeground(Color.red);
ta.setBackground(Color.gray);
ta.setFont(new Font("Arial",Font.BOLD,20));
f.add(p);
p.add(BorderLayout.CENTER,b);
p.add(BorderLayout.EAST,tf);
p.add(BorderLayout.WEST,ta);
f.addWindowListener(new WindowAdapter(){
            @Override
    public void windowClosing(WindowEvent e){
        System.exit(0);
    }
});
f.setSize(500, 500);
f.setVisible(true);
}
}
